﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace ZhaoxiLearningWpf.Common
{
    public static class MD5Provider
    {
        public static string GetMD5(this string str)
        {
            MD5 md5 = MD5.Create();
            byte[] byts = md5.ComputeHash(Encoding.UTF8.GetBytes(str));

            string pwdstr = "";

            foreach (var item in byts) {
                pwdstr += item.ToString("X2");
            }

            return pwdstr;
        }

    }
}
